<?php session_start(); ?>
<!DOCTYPE html>
<html>
    <head>
        <title>Carol Anne Sacred Art Design</title>
	<meta name="description" content="catholic art, roman catholic, christian, art, old art, early christian, artist, carol, anne, cipriani">
	<meta http-equiv="content-type" content="text/html;charset=UTF-8">
	<meta name="ROBOTS" content="INDEX, FOLLOW">
	<link href='http://fonts.googleapis.com/css?family=EB+Garamond' rel='stylesheet' type='text/css'>
        <link href='css/default.css' rel='stylesheet' type='text/css'/>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#wrapper").hide().fadeIn(2000);
				var today = 
				today = new Date().getFullYear();
				$('#footer').html('&copy; ' + today + " Carol Anne Sacred Art. All rights reserved. ");

				$('#loginform').submit( function() {
					$('.error').text("Waiting to log in..").fadeIn("1000");
					$.post("controllers/login_controller.php",{user:$("#user").val(),pass:$("#pass").val()}, function(data) {
						if(data=="yes") {
							$('.error').text("Logging in..").fadeTo(1000,1, function() {
					       		//redirect to secure page
					             document.location='add_works.php';
					       	});
						} else {
							$('.error').text("Invalid Login");
						}
					});
					return false;
				});

				$.getQuery = function( query ) {
					query = query.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
					var expr = "[\\?&]"+query+"=([^&#]*)";
					var regex = new RegExp( expr );
					var results = regex.exec( window.location.href );
					if( results != null ) {
						return results[1];
						return decodeURIComponent(results[1].replace(/\+/g, " "));
					} 
				};

				var query = $.getQuery('message');
				if(query == "success" && query != null) {
					$('.error').slideDown('fast', function() {
						$('.error').text("Image Uploaded Successfully. You should see it below! :)");
					});
				}

				var query = $.getQuery('message');
				if(query == "error" && query != null) {
					$('.error').slideDown('fast', function() {
						$('.error').text("Looks like some error occurred :(");
					});
				}
			});

			function validate() {
				alert("good to go");
				if(($("#title").val() || $("#medium").val() || $("#dim").val() || $("#file").val() || $("#descript").val()) == "") {
					$('.error').text("DON'T LEAVE EMPTY FIELDS!");
					return false;
				} 
				
			}
		</script>
    </head>
    
    <body>
        <div id="wrapper">
			
            <div id="header">
                <h1 style="font-size: 30px; text-align:center; padding:0; margin:0;" >CATHOLIC SACRED ART</h1>
		<h2 style="font-size: 18px; text-align:center;  padding:0; margin:0;">
			ILLUSTRATING TEXTS FROM <br/>
			THE LITTLE OFFICE OF THE BLESSED VIRGIN MARY<br/>
			AND OTHER SACRED SUBJECTS<br/>
		</h2>
		<h2 style="font-size: 14px; text-align:center;  padding:0; margin:0;">BY CAROL ANNE CIPRIANI</h2>
            </div>
            <div id="menu">
				<ul class="menu">
					<li><a class="information" href="index.php">Information</a></li>
					<li><a class="collection" href="collection.php">Collection</a></li>
					<li><a class="links" href="links.php">Links</a></li>		
				</ul>
			</div>
            <div id="content">